<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>类别修改</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_memberAdd.css">
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
<!--数据列表插件开始-->
<link href="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<link href="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Css/etgrid.css" rel="stylesheet" type="text/css">
<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.ui.position.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.contextMenu.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Js/etgrid.js"></script>
<!--数据列表插件结束-->
</head>

<body>
	<div class="page_header">
 	<div class="table_tool">
		<ul class="clearfix">	
			<li class="openwin btn" etitle="新增类别" eheight="400px" ewidth="500px" ehref="{:U('Column/add')}&id={$Think.get.id}" id="Column_add">
				<i class="icon-plus"></i> 新增类别
			</li>
		</ul>
	</div>
	</div>
	<div class="page_wraper" style="margin-top:10px;">
		<div class="page_wraper" style="margin-top:20px;">
			<form action="" method="post" id="memberAdd_form">
			<input type="hidden" id="id" value="{$detail.id}" />
				<table cellpadding="0" cellspacing="0" class="module_form">
					<tr>
						<td style="width:100px;"><label for="title">上级分类：<em>*</em></label></td>
						<td class="ele_content">
							<eq name="detail.pid" value="0">
								暂无上级分类
							<else />
								{$details.title}
							</eq>
						</td>
						
						<!-- <td class="ele_content">
							<select id="pid">
								<option value="0">暂无上级分类</option>
								<volist name="list" id="k">
									<option value="k.id" <eq name="k.id" value="$detail.pid">selected</eq>>{$k.title}</option>
								</volist>
							</select>
						</td> -->
					</tr>
					<tr>
						<td style="width:100px;"><label for="isleaf">有无子类：</label></td>
						<td class="ele_content">
							<select id="isleaf">
								<eq name="detail.isleaf" value="1">
									<option value="1" selected="selected">有</option>
									<option value="2">无</option>
								<else />
									<option value="1">有</option>
									<option value="2" selected="selected">无</option>
								</eq>
								
							</select>
						</td>
					</tr>
					<tr>
						<td class="ele_title"><label for="title">类别名称：<em>*</em></label></td>
						<td class="ele_content">
							<input value="{$detail.title}" type="text" id="title" class="form_ele_text width_200">
						</td>
					</tr>
					<tr>
						<td style="width:100px;"><label for="keywords">关键字：</label></td>
						<td class="ele_content">
							<input type="text" id="keywords" value="{$detail.keywords}" class="form_ele_text width_200">
						</td>
					</tr>
					<tr>
						<td style="width: 100px;"><label for="description">类别描述：<em>*</em></label></td>
						<td class="ele_content">
							<textarea style="height: 150px;" id="description" >{$detail.description}</textarea>
						</td>
					</tr>
				</table>
			</form>
			<div class="page_footer pdtd10">
				<input type="button" name="submit" value="确认修改"  class="form_ele_submit"/>
				<input type="reset" name="reset" value="重置表单"  class="form_ele_reset"/>
			</div>
		</div>
	</div>
	
</body>
<script type="text/javascript">
	//弹出窗口全局变量
	var api = frameElement.api, W = api.opener;

	$(function(){
		//滑动门
		$('.tabbar li').click(function(){
			var tabname = $('.tabbar>ul').attr('tabname');
			$('.tabbar li').removeClass('tabhover');
			$(this).addClass('tabhover');
			
			$('div[fortab="'+tabname+'"]').hide();
			$('#'+$(this).attr('show')).show();
		});
		
		//提交
		$('.form_ele_submit').on('click',function(){
			
			var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
			
			//通过Ajax提交表单
			var postData = {};
			postData.id          = $('#id').val();         //获取上级分类
			postData.pid         = $('#pid').val();         //获取上级分类
			postData.isleaf      = $('#isleaf').val();      //是否有子类
			postData.title       = $('#title').val();       //获取类别名称
			postData.keywords    = $('#keywords').val();    //获取类别关键字
			postData.description = $('#description').val(); //获取类别描述

			$.post("{:U('Column/edit')}", postData ,
				function(data){
					tipsObj.close();
					windowApi.lhgdialog.tips('数据修改成功！',1,etIcon.success,function(){
						
						frameApi.close(); //关闭当前窗口
						var objs = windowApi.lhgdialog.list['Column_index'];
						objs.reload(objs);
					});
				}
			);
		});
	});
</script>
</html>
